package com.czxy.controller;

import com.czxy.domain.User;
import com.czxy.service.UserService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;

@Controller
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;




    @RequestMapping("/findByInfo")
      public  String findByInfo(@RequestParam(defaultValue = "1") Integer pageNum ,@RequestParam(defaultValue = "2") Integer pageSize , Model model , User user){

          PageInfo pageInfo = userService.findByInfo(pageNum, pageSize, user);

          model.addAttribute("pageInfo",pageInfo);

          return "/user/list.jsp";
    }









}
